package com.java1412.common.utils;

/**
 * 通过枚举封装响应状态
 *
 * @author java1412
 * @since 2025-05-16 13:47
 */
public enum ResponseEnum {
    // 用户相关的状态10xx开头
    USER_LOGIN_SUCCESS(1000, "用户登录成功"),
    USER_FIND_ID_SUCCESS(1001, "查询用户信息成功"),
    USER_FIND_ID_FAILURE(1002, "查询用户信息失败"),
    USER_SEND_VERIFY_CODE_SUCCESS(1003, "发送验证码成功"),
    USER_LOGIN_FAILURE_1(1004, "用户登录失败,验证码失效"),
    USER_LOGIN_FAILURE_2(1005, "用户登录失败,手机号不匹配"),
    USER_LOGIN_FAILURE_3(1006, "用户登录失败,手机号和验证码不匹配"),
    USER_LOGIN_FAILURE_4(1007, "用户登录失败,手机号和密码不匹配"),
    USER_LOGIN_FAILURE_5(1008, "用户登录失败,角色不匹配"),
    USER_KAPTCHA_CODE_SUCCESS(1009, "后端生成验证码成功"),
    USER_LOGINNED(1010, "用户已登录"),
    USER_NOT_LOGIN(1011, "用户未登录"),
    USER_LOGOUT_SUCCESS(1012, "注销成功"),
    USER_LOGOUT_FAIL(1013, "注销失败"),
    USER_REGISTER_FAIL(1014, "注册新用户失败"),
    USER_REGISTER_SUCCESS(1015, "注册新用户成功"),
    USER_REAL_NAME_AUTHENTICATION_FAIL(1016, "新用户实名失败"),
    USER_REAL_NAME_AUTHENTICATION_SUCCESS(1017, "新用户实名成功"),
    // jwt状态都用11xx开头
    JWT_VERIFY_SUCCESS(1100, "验证成功"),
    JWT_SIGNATURE_VERIFICATION(1101, "无效签名"),
    JWT_TOKEN_EXPIRED(1102, "token过期"),
    JWT_ALGORITHM_MISMATCH(1103, "token算法不一致"),
    JWT_TOKEN_INVALID(1104, "token无效"),
    // 理财产品表记录理财信息使用12xx开头
    LOAN_INFO_FIND_SUCCESS(1200, "理财产品信息查询成功");
    private Integer code; // 状态码
    private String message; // 提示信息

    ResponseEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
